function pageShow() {
    console.log("pageShow")
}
class A {
    constructor () {}
    setDefault (data) {
        const that = this;
        const onShow = that.onShow  //如果类自身有 componentDidShow方法  就重构一下
        if (onShow && typeof(onShow)=== "function") {
            that.onShow = function () {
                console.log("========重写onShow=========")
                onShow.call(that)
            }
        } else {
            that.componentDidShow = function () { //如果类自身没有 componentDidShow方法  就造一个
                console.log("=========父类继承onShow========")
            }
        }
    }
}
class B extends A{ //自定义了componentDidShow
    constructor(data) {
        super();
        Object.assign(this, this.setDefault(data));
        return Page(data)
    }
}
class C extends A{ //没有componentDidShow
    constructor() {
        super()
    }
}

module.exports = {B, C}